import React from "react";
import "../index.css";

class Left extends React.Component{
    state = {
        time: new Date().toTimeString(),
        timer: ""
    }
    componentDidMount() {
            this.timer = setInterval(()=>{
                this.setState({
                    time: new Date().toTimeString()
                })
            },1000);
    }
    componentWillUnmount() {
        clearInterval(this.timer);
    }
    render() {
        return <div className="left">
            {this.state.time}
        </div>
    }
}

export default Left;